<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>校园二手货</title>
    <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.min.css' %}">
    <link rel="stylesheet" href="{% static 'css/file.css' %}">
    {% load static %}
</head>
<body>
    <div class="nav_head">
        {% if request.session.username|default:'' != '' %}
            <p>欢迎您，{{ request.session.username }}</p>
            <button class="btn btn-default"><a href="/user/logout">退出</a></button>
        {% else %}
            <a class="btn btn-link" href="/user/login">登陆</a>
            <a class="btn btn-link" href="/user/register">注册</a>
        {% endif %}
        <div class="nav dropdown">
            <a class="btn btn-link" href="/user/user_center">| 用户中心</a>
        </div>
        <div class="nav">
            <a class="btn btn-link" href="/">首页</a>
        </div>
    </div>
    
    <div class="title text-center">
        <img src="{% static 'img/title.png' %}" alt="校园二手货标题">
        <div class="second_title">
            <div class="find">
                <button type="button" class="btn btn-warning"><a href="/release_goods">发布闲置</a></button>
            </div>
        </div>      
    </div>

    <!-- 返回最上开始 -->
    <div class="back_to_top">
        <a href="#"><img src="{% static 'img/index-回到最上.png' %}"></a>
    </div>
    <!-- 返回最上结束 -->

    <main class="details container">
        <h2 class="details_title">商品详情</h2>
        <hr/>
        <div class="product-info d-flex">
            <div class="goods">
                <img src="{% static good.picture %}" alt="{{ good.title }}" class="img-fluid">
            </div>
            <div class="attribute">
                <p><strong>商品名称：</strong><span>{{ good.title }}</span></p>
                <p><strong>商品价格：</strong><span>{{ good.price }}</span></p>
                <p><strong>交易地点：</strong><span>{{ good.address }}</span></p>
                <p><strong>商家昵称：</strong><span>{{ good.user.username }}</span></p>
            </div>
        </div>

        <div class="text-right">
            <button class="btn btn-warning btn-lg">
                <a href="{% url 'chat:create_chatroom' good.id %}" class="text-white">感兴趣</a>
            </button>
        </div>

        <h3 class="details_title">详情描述</h3>
        <hr/>
        <div class="attribute_goods">
            {{ good.description }}
        </div>
    </main>

    <div class="foot">
        <img src="{% static 'img/title2.png' %}">
        <p>来校园二手货，你的闲置能换钱！</p>
        <span>全国最大最活跃的校园闲置物品交换平台</span>
    </div>
    <address>
        
    </address>

    <script src="{% static 'js/jquery-3.3.1.min.js' %}"></script>
    <script src="{% static 'js/bootstrap.min.js' %}"></script>
    <script src="{% static 'js/file.js' %}"></script>
    {% include 'includes/websocket.html' %}
</body>
</html>